package com.xgjweb.fsi.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.xgjweb.common.action.XgjWebAction;
import com.xgjweb.fsi.domain.User;
import com.xgjweb.fsi.service.IUserService;

public class UserAction extends XgjWebAction {
	IUserService userService;

	public void setUserService(IUserService userService) {
		this.userService = userService;
	}

	/**
	 * 登录
	 * 
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public User login(User user) throws Exception {
		return userService.login(user);
	}

	/**
	 * 注册
	 * 
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public String register(User user) throws Exception {
		return userService.register(user);
	}

	/**
	 * 修改
	 */
	public String updateInfo(User user) throws Exception {
		return userService.updateInfo(user);
	}

	/**
	 * 图片上传
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public ActionForward imgageChange(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception { 
		userService.imageChange(mapping, form, request, response);
		return null;
	}
}
